<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <link rel="stylesheet" href="../Cesium/Widgets/widgets.css">
    <style>
        html,body {
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        #board{
            position: absolute;
            top: 100px;
            left: 50px;
            width: 200px;
            height: 200px;
            background: rgba(255,255,255,.7);
            padding: 20px;
            z-index: 100;
        }
    </style>
    <script src="../Cesium/Cesium.js"></script>
</head>
<body>
    <div id="cesiumContainer">
        <div id="board">
            <button id="addPoint">画点</button>
            <button id="addLine">画线</button>
            <button id="addArea">画面</button>
            <button id="viewDis">透视分析</button>
            <button id="viewArea">视野分析</button>
        </div>
    </div>
    <script>
        const viewer = new Cesium.Viewer("cesiumContainer", {
            animation: false, // 是否创建动画小器件
            timeline: false, // 是否显示时间控件
            fullscreenButton: false, // 是否显示全屏按钮
            geocoder: false, // 是否显示地名查找控件
            baseLayerPicker: true, // 是否显示图层选择控件
            vrButton: false,
            orderIndependentTranslucency: false,
            contextOptions: {
                webgl: {
                    alpha: true
                }
            }
        });
        // viewer.scene.skyBox.show = false;
        // viewer.scene.backgroundColor = new Cesium.Color(0, 0, 0, 0);
        viewer.imageryLayers.removeAll(true);
        //天地图影像地图
        viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider({
            url: "http://{s}.tianditu.com/img_w/wmts?tk=0f84da9fd48038ea3bd8de15ff9fb4c2&service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles",
            subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7', ],
            maximumLevel: 18,
            layer: "tdtBasicLayer",
            style: "default",
            format: "image/jpeg",
            tileMatrixSetID: "GoogleMapsCompatible",
            show: true
        }));

        //天地图矢量图标注
        viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider({
            url: "http://{s}.tianditu.com/cia_w/wmts?tk=0f84da9fd48038ea3bd8de15ff9fb4c2&service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles",
            subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7', ],
            maximumLevel: 18,
            layer: "tdtAnnoLayer",
            style: "default",
            format: "image/jpeg",
            tileMatrixSetID: "GoogleMapsCompatible",
            TileMatrixLables: ['1', '2', '3', '4', '5', '6', '7'],
            show: true
        }));

        // 加载倾斜模型数据
        viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
            // url: '/tileset/tileset.json',
            url: 'http://popcity.popsmart.cn:9001/data/lishui/fs_b3dm/tileset.json',
            maximumScreenSpaceError: 2,       // 最大的屏幕空间误差
            maximumNumberOfLoadedTiles: 10000,  // 最大加载瓦片个数
            // modelMatrix: m
        }));

        viewer.camera.flyTo({
            destination : Cesium.Cartesian3.fromDegrees(121.34338888888888, 29.259416666666668, 600.0),
            orientation: {
                pitch : Cesium.Math.toRadians(-40.0),
            }
        });


    </script>
    <script src="SimpleC.js"></script>
    <script src="index.js"></script>
    <script src="btnBind.js"></script>
</body>
</html>